package com.lc.qianrenshiye.conn;

import com.zcx.helper.http.AsyCallBack;
import com.zcx.helper.http.note.HttpInlet;

import org.json.JSONObject;

/**
 * Created by Administrator on 2016/12/20.
 */
@HttpInlet(Conn.PAYMENT_INDEX)
public class OrderPriceGet extends BaseAsyGet<OrderPriceGet.OrderPriceEntity> {

    public String oid;

    public OrderPriceGet(AsyCallBack<OrderPriceEntity> asyCallBack) {
        super(asyCallBack);
    }

    @Override
    protected OrderPriceEntity parser(JSONObject object) throws Exception {


        TOAST = object.optString("message");

        if (object.optInt("code") == 200) {

            OrderPriceEntity order = new OrderPriceEntity();

            JSONObject orderObject = object.optJSONObject("data");

            order.oid = orderObject.optString("oid");
            order.ordersn = orderObject.optString("ordersn");
            order.amount = orderObject.optString("amount");

            return order;

        }

        return null;
    }

    public static class OrderPriceEntity {

        public String oid, ordersn, amount;

    }

}
